import request from '@/utils/request'

export function travelList(query) {
  return request({
    url: '/travels',
    method: 'get',
    params: query
  })
}

export function travelAdd(data) {
  return request({
    url: '/travel',
    method: 'post',
    data
  })
}

export function travelDelete(id) {
  return request({
    url: `/travel/${id}`,
    method: 'delete'
  })
}

export function travelUpdate(id, data) {
  return request({
    url: `/travel/${id}`,
    method: 'put',
    data
  })
}

export function travelChange(id, data) {
  return request({
    url: `/travel/change/${id}`,
    method: 'put',
    data
  })
}

export function travelSubmit(id, data) {
  return request({
    url: `/travel/${id}/submit`,
    method: 'put',
    data
  })
}

export function travelDrawback(id, data) {
  return request({
    url: `/travel/${id}/drawback`,
    method: 'put',
    data
  })
}

export function travelEmps(travelId) {
  return request({
    url: `/travel/${travelId}/emps`,
    method: 'get',
    params: travelId
  })
}
